#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

struct Glade {
    long long a; // Growth rate
    long long b; // Initial count
};

int main() {
    int n;
    cin >> n;

    vector<Glade> glades(n);
    bool all_same = true;
    long long first_a, first_b;

    for (int i = 0; i < n; ++i) {
        cin >> glades[i].a >> glades[i].b;
        if (i == 0) {
            first_a = glades[i].a;
            first_b = glades[i].b;
        }
        else {
            if (glades[i].a != first_a || glades[i].b != first_b) {
                all_same = false;
            }
        }
    }

    if (all_same) {
        // If all ai and bi are the same, output directly using the formula
        for (int k = 1; k <= n; ++k) {
            cout << k * first_b + first_a * k * (k - 1) / 2 << "\n";
        }
    }
    else {
        // Process each day, calculating maximum possible mushrooms collected
        vector<vector<long long>> totals(n, vector<long long>(n, 0));

        for (int k = 1; k <= n; ++k) {
            vector<long long> dailyTotals(n);
            for (int i = 0; i < n; ++i) {
                dailyTotals[i] = glades[i].b + glades[i].a * (k - 1);
            }

            // Sort indices based on daily totals (descending order)
            vector<int> indices(n);
            iota(indices.begin(), indices.end(), 0);
            sort(indices.begin(), indices.end(), [&](int i, int j)
                { return dailyTotals[i] > dailyTotals[j]; });

            // Now sort these indices based on the growth rates (ascending order)
            sort(indices.begin(), indices.begin() + k, [&](int i, int j)
                { return glades[i].a < glades[j].a; });

            // Compute the totals based on sorted indices for each day
            for (int idx = 0; idx < k; ++idx) {
                int gladeIndex = indices[idx];
                totals[k - 1][idx] = glades[gladeIndex].b + glades[gladeIndex].a * (idx);
            }
        }

        // Output the results: summing up the calculated totals for each day
        for (int k = 0; k < n; ++k) {
            long long sum = 0;
            for (int i = 0; i <= k; ++i) {
                sum += totals[k][i];
            }
            cout << sum << "\n";
        }
    }

    return 0;
}
